package com.will.txj.aj.security.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;

/**
 * @author: wen-yi;
 * @date: 2021/12/5 23:31;
 * @Description: 资源服务器配置
 */
//@Configuration
//@EnableResourceServer
public class ResourceServiceConfig extends ResourceServerConfigurerAdapter {
    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
            //放行资源
            .antMatchers("/pages/**","/resource/**","/doc.html","/auth/**","/captcha/**","/oauth/**").permitAll()
            //所有请求必须认证
            .anyRequest().authenticated();
    }
}
